<template>
    <div>
        <div class="text-2xl">
            错误页面 :  {{ errorMessage }}
        </div>
    </div>
</template>

<script setup lang="ts">
const errorMessage = ref('')

// 页面挂载完成后仅客户端才会执行
onMounted(() => {
    const route = useRoute()
    const { result, message } = route.query
    switch(result) {
        case '-4000':
        case '-4001':
        case '-4003':
            ElMessage.error(message as string)
            useUserStore().setToken("")
            navigateTo("/login")
            break
        case '500':
            // ElMessage.error(message as string)
            break
        default:
            break
    }
    errorMessage.value = message as string
})
</script>

<style scoped>

</style>